<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加模块信息</title>
	<script src="jquery/jquery-3.0.0.min.js"></script>
	<script>
		$(function () {
			$.ajax({
				type: "POST",
				dataType:"json",
				url: "${pageContext.request.contextPath}/GetAllProjectNameServlet",
				success:function (msg) {
					$.each(msg,function (index,ele) {
						$("select[id=project]").append("<option value=\'"+ele.project_id+"\'>"+ele.project_name+"</option>");
					});
				}
			})

			$.ajax({
				type:"POST",
				dataType:"json",
				url:"${pageContext.request.contextPath}/GetAllRequirementNameServlet",
				success:function (mag) {
					$.each(mag,function (index1,ala) {
						$("select[id=requirement]").append("<option value=\'"+ala.requirement_id+"\'>"+ala.title+"</option>");
					})
				}

			})
			$("#save").click(function () {
				$.ajax({
					type:"POST",
					data:$("form").serialize(),
					url:"${pageContext.request.contextPath}/ModelAddServlet",
					success:function () {
							alert("保存成功")
							location.href = "${pageContext.request.contextPath}/project-base.jsp"
					}
				})
			})
		})
	</script>
<link rel="stylesheet" type="text/css" href="skin/css/base.css">
</head>
<body leftmargin="8" topmargin="8" background='skin/images/allbg.gif'>

<!--  快速转换位置按钮  -->
	<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA" align="center">
		<tr>
			 <td height="26" background="skin/images/newlinebg3.gif">
			  	<table width="58%" border="0" cellspacing="0" cellpadding="0">
			 		 <tr>
			 			<td >
			 			  当前位置:项目管理>>添加模块信息
			 			</td>
			 		</tr>
				</table>
			</td>
		</tr>
	</table>

	<form name="form2">

		<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
			<tr bgcolor="#E7E7E7">
				<td height="24" colspan="2" background="skin/images/tbg.gif">&nbsp;添加新模块&nbsp;</td>
			</tr>
			<tr >
				<td align="right" bgcolor="#FAFAF1" height="22">选择项目：</td>
				<td  align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><select name="project_id" id="project"></select></td>
<%--				<option value=1>农业银行自助管理系统</option>--%>
			</tr>
			<tr >
				<td align="right" bgcolor="#FAFAF1" height="22">选择需求：</td>
				<td  align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><select name="requirement_id" id="requirement"></select></td>
<%--				<option>账户需求管理分析</option>--%>
			</tr>
			<tr >
				<td align="right" bgcolor="#FAFAF1" height="22">模块名称：</td>
				<td  align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><input name="model_name"/></td>
			</tr>
			<tr >
				<td align="right" bgcolor="#FAFAF1" height="22">优先级：</td>
				<td  align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><select name="priority"><option>高</option><option>中</option><option>低</option><option>暂缓</option></select></td>
			</tr>
			<tr >
				<td align="right" bgcolor="#FAFAF1" height="22">简单描述：</td>
				<td align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><textarea rows=10 cols=130 name="simple_desc"></textarea></td>
			</tr>
			<tr >
				<td align="right" bgcolor="#FAFAF1" height="22">详细描述：</td>
				<td align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22"><textarea rows=15 cols=130 name="complplex_desc"></textarea></td>
			</tr>

			<tr >
				<td align="right" bgcolor="#FAFAF1" >备注：</td>
				<td colspan=3 align='left' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" >
					<textarea rows=10 cols=130 name="remark"></textarea>
				</td>
			</tr>


			<tr bgcolor="#FAFAF1">
				<td height="28" colspan=4 align=center>
					&nbsp;
					<a  class="coolbg" id="save">保存</a>
<%--					//href="project-model.jsp"--%>
					<a href="project-model.jsp" class="coolbg" id="return">返回</a>
<%--					<input type="button" name="save" id="save" value="保存">--%>
<%--					<input type="button" id="return" value="返回">--%>

				</td>
			</tr>
		</table>

	</form>

</body>
</html>